package de.gbeine.java.depview.ui.component;

import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JSplitPane;

import org.springframework.beans.factory.annotation.Required;

import de.gbeine.java.depview.ui.graph.VisualizationViewer;

/**
 *
 * @author gbeine
 *
 */
public final class MainContentPanel extends JPanel {

    /**
     *
     */
    private static final long serialVersionUID = 5266281466139698847L;
    /**
     *
     */
    private JSplitPane spltPnContent;
    /**
     *
     */
    private JSplitPane spltPnControl;

    /**
     * Create the panel.
     */
    public MainContentPanel() {
        this.setLayout(new GridLayout(0, 1, 0, 0));
        this.spltPnContent = new JSplitPane();
        this.spltPnContent.setResizeWeight(1.0);
        this.add(this.spltPnContent);

        this.spltPnControl = new JSplitPane();
        this.spltPnControl.setOrientation(JSplitPane.VERTICAL_SPLIT);
        this.spltPnContent.setRightComponent(this.spltPnControl);
    }

    /**
     *
     * @param pGraphPanel
     */
    @Required
    public void setGraphPanel(final VisualizationViewer pGraphPanel) {
        this.spltPnContent.setLeftComponent(pGraphPanel);
    }

    /**
     *
     * @param pFilterPanel
     */
    @Required
    public void setFilterPanel(final FilterPanel pFilterPanel) {
        this.spltPnControl.setRightComponent(pFilterPanel);
    }

    /**
     *
     * @param pInformationPanel
     */
    @Required
    public void setInformationPanel(final InformationPanel pInformationPanel) {
        this.spltPnControl.setLeftComponent(pInformationPanel);
    }
}
